package sc.prototype.pfs.eventnotify.model;

import java.util.List;

import sc.prototype.common.Utils;

/**
 * 通知上下文
 */
public class NotifyContext {

    public NotifyContext() {
    }

    public NotifyContext(NotifyEvent event, List<NotifyConfig> configs, String logPrefix) {
        this.event = event;
        this.configs = configs;
        this.logPrefix = logPrefix;
    }

    /** 触发事件 */
    NotifyEvent event;

    /** 匹配的通知配置 */
    List<NotifyConfig> configs;

    /** 日志标识前缀 */
    String logPrefix;

    /** 是否记录上下文 */
    boolean logContext;

    public NotifyEvent getEvent() {
        return event;
    }

    public void setEvent(NotifyEvent event) {
        this.event = event;
    }

    public List<NotifyConfig> getConfigs() {
        return configs;
    }

    public void setConfigs(List<NotifyConfig> configs) {
        this.configs = configs;
    }

    public String getLogPrefix() {
        return logPrefix;
    }

    public void setLogPrefix(String logPrefix) {
        this.logPrefix = logPrefix;
    }

    public boolean isLogContext() {
        return logContext;
    }

    public void logContext() {
        this.logContext = true;
    }

    @Override
    public String toString() {
        return Utils.toString(this);
    }

}
